<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>登录 - 大学生体质测试管理系统</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <style>
        body {
            background-image: url('https://source.unsplash.com/1920x1080/?university,study');
            background-size: cover;
            background-position: center;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .login-container {
            background: rgba(255, 255, 255, 0.9);
            padding: 2rem;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
        }
        .login-title {
            text-align: center;
            color: #2c3e50;
            margin-bottom: 2rem;
        }
        .form-group {
            margin-bottom: 1.5rem;
        }
        .btn-login {
            background-color: #2c3e50;
            color: white;
            width: 100%;
            padding: 0.8rem;
        }
        .btn-login:hover {
            background-color: #34495e;
            color: white;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <h2 class="login-title">大学生体质测试管理系统</h2>
        <form id="loginForm">
            <div class="form-group">
                <input type="text" class="form-control" id="username" placeholder="用户名/学号" required>
            </div>
            <div class="form-group">
                <input type="password" class="form-control" id="password" placeholder="密码" required>
            </div>
            <div class="form-group">
                <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="userType" id="student" value="student" checked>
                    <label class="form-check-label" for="student">学生</label>
                </div>
                <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="userType" id="teacher" value="teacher">
                    <label class="form-check-label" for="teacher">教师</label>
                </div>
                <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="userType" id="admin" value="admin">
                    <label class="form-check-label" for="admin">管理员</label>
                </div>
            </div>
            <button type="submit" class="btn btn-login">登录</button>
        </form>
    </div>

    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <script>
        $(document).ready(function() {
            $('#loginForm').on('submit', function(e) {
                e.preventDefault();
                
                // 这里是示例登录验证，实际应该连接后端API
                const username = $('#username').val();
                const password = $('#password').val();
                const userType = $('input[name="userType"]:checked').val();
                
                // 根据不同用户类型跳转到不同页面
                if (username && password) {
                    switch(userType) {
                        case 'admin':
                            if (username === 'admin' && password === 'admin') {
                                window.location.href = 'admin.html';
                            } else {
                                alert('管理员账号或密码错误！');
                            }
                            break;
                        case 'teacher':
                            if (username === 'teacher' && password === 'teacher') {
                                window.location.href = 'teacher.html';
                            } else {
                                alert('教师账号或密码错误！');
                            }
                            break;
                        case 'student':
                            if (username === 'student' && password === 'student') {
                                window.location.href = 'student.html';
                            } else {
                                alert('学生账号或密码错误！');
                            }
                            break;
                    }
                }
            });
        });
    </script>
</body>
</html>